﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace WoBian.MyViewEngines
{
    public class WoBianViewEngine : RazorViewEngine
    {
        public WoBianViewEngine()
        {
            base.MasterLocationFormats = new string[] { "~/Views/Admin/{1}/{0}.cshtml", "~/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml", "~/Views/User/{1}/{0}.cshtml" };
            base.ViewLocationFormats = base.MasterLocationFormats;
            base.PartialViewLocationFormats = base.ViewLocationFormats;
            base.FileExtensions = new string[] { "cshtml" };
        }

        public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
        {
            return base.FindView(controllerContext, viewName, masterName, useCache);
        }

        public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache)
        {
            return base.FindPartialView(controllerContext, partialViewName, useCache);
        }
    }
}